package com.mmall.dao;

import com.mmall.pojo.Cart;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface CartMapper {

    int deleteByPrimaryKey(Integer id);

    int insert(Cart record);

    Cart selectByPrimaryKey(Integer id);

    List<Cart> selectAll();

    int updateByPrimaryKey(Cart record);

    Cart selectProductByUserIdAndProductId(@Param("userId") Integer userId, @Param("productId") Integer productId);

     int updateSelectiveByPrimaryKey(Cart cart);

     List<Cart> selectCartByUserId(Integer userId);

    int checkedAll(Integer userId);

    int deleteByUserIdAndProductId(@Param("userId") Integer userId,@Param("productIdList") List<String> productIdList);

    int  updateCheckedOneOrAll(@Param("userId") Integer userId,@Param("productId") Integer productId,@Param("checked") Integer checked) ;

   List<Cart> selectCartByUserIdChecked(Integer userId);


}